//
//  CMDBUserInfoManagerDelegate.swift
//  CMDB
//
//  Created by 王磊 on 17/4/5.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

protocol CMDBUserInfoManagerDelegate: NSObjectProtocol {
    
    // 修改资料
    func modifyUserInfo(modifyInfoParam: CMDBModifyUserInfoParam ,success: CMDBModifyUserInfoHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler) throws
    // 查询用户资料
    func queryUserInfo(userInfoParam: CMDBUserInfoParam,handler: CMDBUserInfoHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler)
    // 缓存用户信息
    func saveUserInfo(userInfo: CMDBUserInfoBean,identifier: String)
    // 查询用户信息缓存 如果为nil 可以throw
    func queryUserInfoCache(identifier: String) throws -> CMDBUserInfoBean
    
    // 当用户详情vc 销毁的时候 调用下面的函数
    
    func saveUserInfo(identifier: String)
    
    //  验证原密码
    func vertifyPassword(verifyPwdParam: CMDBVerifyPasswordParam,handler: CMDBVerifyPwdHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler) throws
    
    // 绑定手机号
    func bindPhone(bindPhoneParam: CMDBBindPhoneParam,handler: CMDBModifyUserInfoHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler) throws
    
    func bindEmail(bindEamilParam: CMDBBindEmailParam,handler: CMDBModifyUserInfoHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler) throws
    
    
    // /app/user/v1/getFans
    func queryFans(fansParam: CMDBFansListParam,tableView: UITableView,handler: CMDBFansListHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler)
    
    //    func saveFavorMeList(favorList: Array<CMDBUserInfoBean>,identifier: String)
    //
    //    func queryFavorMeList(identifier: String) throws -> Array<CMDBUserInfoBean>
    
    // 用户-好友列表-getFriends
    func queryFriends(friendsParam: CMDBFriendsListParam,tableView: UITableView,handler: CMDBFriedsListHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler)
    
    //    func saveMyFavorList(favorList: Array<CMDBUserInfoBean>,identifier: String)
    //
    //    func queryMyFavorList(identifier: String) throws -> Array<CMDBUserInfoBean>
    
    
    func queryFollows(followsParam: CMDBQueryFollowsParam,tableView: UITableView,handler: CMDBFollowsListHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler)
    
    func queryLanguages(languageParam: CMDBLanguageParam,handler: CMDBLanguageListHandler,error: CMDBHttpErrorHandler,failure: CMDBHttpFailureHandler)
}
